import { Socket } from "socket.io-client";

interface ServerToClientEvents {
  chat_msg: (msg: string) => void;
  server: () => void;
}

interface ClientToServerEvents {
  chat_msg: (msg: string) => void;
  client: () => void;
}
// 注意，这里类型事件是有顺序的，先服务端后客户端，可以查阅 https://socket.io/docs/v4/typescript/#types-for-the-client
export type SocketType = Socket<ServerToClientEvents, ClientToServerEvents>;
